	.file	"mystdio.c"
	.text
	.globl	mfopen
	.type	mfopen, @function
mfopen:
.LFB2:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$-1, -4(%rbp)
	movq	-32(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$114, %al
	jne	.L2
	movq	-24(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	movl	$0, %eax
	call	open
	movl	%eax, -4(%rbp)
	jmp	.L3
.L2:
	movq	-32(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$119, %al
	jne	.L4
	movq	-24(%rbp), %rax
	movl	$438, %edx
	movl	$577, %esi
	movq	%rax, %rdi
	movl	$0, %eax
	call	open
	movl	%eax, -4(%rbp)
	jmp	.L3
.L4:
	movq	-32(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$97, %al
	jne	.L3
	movq	-24(%rbp), %rax
	movl	$438, %edx
	movl	$1089, %esi
	movq	%rax, %rdi
	movl	$0, %eax
	call	open
	movl	%eax, -4(%rbp)
.L3:
	movl	$8208, %edi
	call	malloc
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	jne	.L5
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	close
	movl	$0, %eax
	jmp	.L6
.L5:
	movq	-16(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	movq	-16(%rbp), %rax
	movl	$1, 4(%rax)
	movq	-16(%rbp), %rax
	movl	$1024, 8200(%rax)
	movq	-16(%rbp), %rax
	movl	$0, 8204(%rax)
	movq	-16(%rbp), %rax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	mfopen, .-mfopen
	.globl	mfwrite
	.type	mfwrite, @function
mfwrite:
.LFB3:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	strlen
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	movl	8204(%rax), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	leaq	8(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	call	memcpy
	movq	-40(%rbp), %rax
	movl	8204(%rax), %eax
	movl	%eax, %ebx
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	strlen
	addl	%ebx, %eax
	movl	%eax, %edx
	movq	-40(%rbp), %rax
	movl	%edx, 8204(%rax)
	movq	-40(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	$1, %eax
	jne	.L8
	movq	-40(%rbp), %rax
	movl	8204(%rax), %eax
	testl	%eax, %eax
	jle	.L12
	movq	-40(%rbp), %rax
	movl	8204(%rax), %eax
	leal	-1(%rax), %edx
	movq	-40(%rbp), %rax
	movslq	%edx, %rdx
	movq	8(%rax,%rdx,8), %rax
	cmpq	$10, %rax
	jne	.L12
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	movq	-24(%rbp), %rcx
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	write
	movq	-40(%rbp), %rax
	movl	8204(%rax), %edx
	movq	-40(%rbp), %rax
	movslq	%edx, %rdx
	movq	$50, 8(%rax,%rdx,8)
	movq	-40(%rbp), %rax
	movl	$0, 8204(%rax)
	jmp	.L12
.L8:
	movq	-40(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	$2, %eax
	jne	.L12
	movq	-40(%rbp), %rax
	movl	8204(%rax), %esi
	movq	-40(%rbp), %rax
	movl	8200(%rax), %edx
	movl	%edx, %eax
	sall	$3, %eax
	leal	(%rax,%rdx), %ecx
	movl	$1717986919, %edx
	movl	%ecx, %eax
	imull	%edx
	sarl	$2, %edx
	movl	%ecx, %eax
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	cmpl	%eax, %esi
	jle	.L11
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	movq	-24(%rbp), %rcx
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	write
.L11:
	movq	-40(%rbp), %rax
	movl	$0, 8204(%rax)
.L12:
	addq	$40, %rsp
	popq	%rbx
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	mfwrite, .-mfwrite
	.globl	mfflush
	.type	mfflush, @function
mfflush:
.LFB4:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	leaq	8(%rax), %rcx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	$1024, %edx
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	write
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	mfflush, .-mfflush
	.globl	mfclose
	.type	mfclose, @function
mfclose:
.LFB5:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, %edi
	call	close
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	mfclose, .-mfclose
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.ident	"GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-44)"
	.section	.note.GNU-stack,"",@progbits
